package com.jeason.blogmpg.mapper;

import com.jeason.blogmpg.entity.Todo;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import org.apache.ibatis.annotations.Param;
import org.apache.ibatis.annotations.Select;

/**
 * <p>
 * 代办事项表 Mapper 接口
 * </p>
 *
 * @author jeason
 * @since 2021-01-13
 */
public interface TodoMapper extends BaseMapper<Todo> {

    /**
     * 批量更新未删除的代表事项的状态
     *
     * @param done
     * @param adminUid
     */
    @Select("UPDATE t_todo SET done = #{done} WHERE STATUS = 1 AND admin_uid = #{adminUid}")
    public void toggleAll(@Param("done") Integer done, @Param("adminUid") String adminUid);
}
